package com.feiyi.app.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.feiyi.app.R;
import com.feiyi.app.bean.MyYouhuiBean;

import java.util.List;

/**
 * @author wangliantao
 * @time 2018 11 2018/11/18 5:45 PM
 * @email 1346947404@qq.com
 * @package com.feiyi.app.adapter
 * @describe： In me the tiger sniffs the rose
 */
public class MyYouhuiAdapter extends BaseQuickAdapter<MyYouhuiBean.DataBean,BaseViewHolder> {
    public MyYouhuiAdapter(int layoutResId, @Nullable List<MyYouhuiBean.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MyYouhuiBean.DataBean item) {

        helper.setText(R.id.tv_yh_num,item.getType_money())
                .setText(R.id.tv_yh_limit,item.getUse_enddate())
                .setText(R.id.tv_yh_manjian,item.getMin_goods_amount())
                .setText(R.id.tv_yh_source,item.getType_name());
    if (item.getStatus() == 0){
        helper.setBackgroundRes(R.id.rl_yh_left,R.mipmap.youhui_bg_used);
    }else {
        helper.setBackgroundRes(R.id.rl_yh_left,R.mipmap.youhui_bg);
}
    }
}
